The redundant array of independent disks (RAID) is a technology combining hardware and software to enhance fault tolerance for storing and protecting data when a disk failure occurs, such as, crash or damaged. The RAID technology assembles a plurality of disks with a relatively low price to form a software disk array so that the performance reaches or even over a single large disk at a high price. The RAID technology may save the data and the corresponding parity when crossing each disk. A protection stripe includes a series of pages from different disks. A page is a unit for data storing in a disk. The stripe size is defined as the number of disk drives in a disk array. The RAID technology often uses a round-robin scheme to ensure each stripe is distributed evenly to each disk.
Adding a parity block to a set of source bits may ensure the number of set bits of the output outcome is even or odd, and the number of set bits is the number of bits having the value 1. An error correction code (ECC, or parity) module may use at least one ECC or error detection code, such as, Reed-Solomon (RS) code, cyclic redundancy check (CRC) code.
In a RAID structure, when a disk fails, the data on each stripe may be rebuilt by using the hardware to check the ECC/parity distributed in each disk, and other disks may rebuild the data stored in the failed disk by checking the distributed ECC/parity. RAID5 is one of the RAID technologies. At least three disks are used for configuring the RAID5. FIG. 1 shows a schematic view of a configuration of a RAID5 system. As shown in FIG. 1, a RAID5 system stores all the ECCs in each disk in a stripe manner. Each disk stores different data in different pages, and each disk also stores a corresponding ECC. Each stripe includes data from N−1 different disks and an ECC from a remaining disk, where N is the stripe size, i.e., the number of the disks in a stripe. In the present example, N=4. When a disk fails, other disks may rebuild the data stored in the failed disk by an ECC checking. In RAID5, because all the ECCs need to use the capacity of one disk for checking, the actual disk capacity for use is N−1.
In a stripe, when distributing the data to each disk of the array, the stripe is defined as a full stripe when the stripe has the capacity of the maximum allowed data storage capacity. In other words, a full stripe is a stripe formed by using the largest allowed number of disks. Therefore, the full stripe has a high write performance, i.e., a fast speed. Another type of stripe is a partially filled stripe which has a smaller capacity than the stripe size. When the partially filled stripe is often randomly accessed, the write performance is low, as shown in FIG. 2. When receiving an I/O command, data 1 and an ECC are read from a disk to a memory, such as, a random access memory (RAM). As shown in FIG. 2, the partially filled stripe must compute a new ECC and write the data 1 to the same location in the disk. When the RAM has no sufficient space and is randomly accessed frequently, the write workload is increased and the write performance is lowered.
FIG. 3 shows a technique of memory backup in a RAID system. This technique provides a volatile memory 324 and a non-volatile memory 358 to the RAID system. The RAID system uses a RAID controller 312 to detect the failure of a main power supply. When the RAID controller 312 detects the failure of the main power supply, a temporary power supply 354 supplies a temporary power to the volatile memory 324 so that the RAID controller 312 may transfer the data from the volatile memory 324 to the non-volatile memory 358. In other words, the technique provides the volatile memory and the additional power supply for data backup in RAID system.
In the above data protection techniques, when processing data in the partially filled stripe, one of possible challenges is how to ensure saving the stripe data and successfully rebuild the stripe data, and how to ensure the uniform distribution of the data and the ECC/parity to each disk. Hence, designing a technique for data storing and rebuilding under the stripe architecture is one of important issues.